package com.ruoyi.employee.domain;

import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.annotation.Excel.ColumnType;
import com.ruoyi.common.annotation.Excel.Type;
import com.ruoyi.common.annotation.Excels;
import com.ruoyi.common.core.domain.UserEntity;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.market.domain.ConfigBase;
import com.ruoyi.market.domain.Level;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.math.BigDecimal;

/**
 * 店员对象 employee_user
 * 
 * @author ruoyi
 */
public class EmployeeUser extends UserEntity
{
    private static final long serialVersionUID = 1L;

    /** 店员ID */
    @Excel(name = "店员序号", cellType = ColumnType.NUMERIC, prompt = "店员编号")
    private Long userId;

    /** 部门ID */
    @Excel(name = "部门编号", type = Type.IMPORT)
    private Long deptId;

    /** 店铺ID */
    private String shopId;

    /** 是否实名 */
    @Excel(name = "是否实名", readConverterExp = "Y=是,N=否, 未知")
    private String isRealName;

    /** 真名 */
    @Excel(name = "真名")
    private String realName;

    /** 微信Id */
    @Excel(name = "微信Id")
    private String wxId;

    /** 收款码 */
    @Excel(name = "收款码")
    private String qrCode;

    /** 用户openId */
    private String openId;

    /** 是否自动接单 */
    @Excel(name = "是否自动接单", readConverterExp = "Y=是,N=否, 未知")
    private String autoOrder;

    /** 服务类型 */
    @Excel(name = "服务类型")
    private String serviceType;

    /** 店员标签 */
    @Excel(name = "店员标签")
    private String tags;

    /** 店员自我介绍 */
    @Excel(name = "店员自我介绍")
    private String userProfile;

    /** 店员图片集合 */
    @Excel(name = "店员图片集合")
    private String images;

    /** 店员录音 */
    @Excel(name = "店员录音")
    private String speech;

    /** 在线状态（0正常 1忙碌 2下线） */
    @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
    private String status;

    /** 是否收藏（Y-是 N-否） */
    @Excel(name = "是否收藏", readConverterExp = "Y=是,1=停用")
    private String isLike;

    /** 是否需要审核动态（Y-是 N-否） */
    @Excel(name = "是否需要审核动态", readConverterExp = "Y=是,N=否")
    private String isDynamicAudit;

    /** 新人列表展示（Y-是 N-否） */
    @Excel(name = "新人列表展示", readConverterExp = "Y=是,N=否")
    private String isNewShow;

    /** 排序 */
    @Excel(name = "排序")
    private Integer userSort;

    /** 用户等级 */
    @Excel(name = "用户等级")
    private Long userLevel;

    /** 部门对象 */
    @Excels({
        @Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
        @Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT)
    })
    private SysDept dept;

    /** 所属店铺信息   */
    private ConfigBase shopInfo;

    /** 所属店铺信息   */
    private Level levelInfo;


    public EmployeeUser()
    {

    }

    public EmployeeUser(Long userId)
    {
        this.userId = userId;
    }

    public Long getUserId()
    {
        return userId;
    }

    public void setUserId(Long userId)
    {
        this.userId = userId;
    }

    public String getShopId(){ return shopId; }

    public void setShopId(String shopId){ this.shopId = shopId; }

    public boolean isAdmin()
    {
        return isAdmin(this.userId);
    }

    public static boolean isAdmin(Long userId)
    {
        return userId != null && 1L == userId;
    }

    public Long getDeptId()
    {
        return deptId;
    }

    public void setDeptId(Long deptId)
    {
        this.deptId = deptId;
    }

    public String getServiceType()
    {
        return serviceType;
    }

    public void setServiceType(String serviceType)
    {
        this.serviceType = serviceType;
    }

    public Integer getUserSort()
    {
        return userSort;
    }

    public void setUserSort(Integer userSort)
    {
        this.userSort = userSort;
    }

    @NotBlank(message = "标签不能为空")
    @Size(min = 0, max = 30, message = "标签长度不能超过30个字符")
    public String getTags()
    {
        return tags;
    }

    public void setTags(String tags)
    {
        this.tags = tags;
    }

    @NotBlank(message = "自我介绍不能为空")
    @Size(min = 0, max = 100, message = "自我介绍长度不能超过100个字符")
    public String getUserProfile()
    {
        return userProfile;
    }

    public void setUserProfile(String userProfile)
    {
        this.userProfile = userProfile;
    }

    public String getImages()
    {
        return images;
    }

    public void setImages(String images)
    {
        this.images = images;
    }

    public String getSpeech()
    {
        return speech;
    }

    public void setSpeech(String speech)
    {
        this.speech = speech;
    }

    public String getIsRealName()
    {
        return isRealName;
    }

    public void setIsRealName(String isRealName)
    {
        this.isRealName = isRealName;
    }

    public String getRealName()
    {
        return realName;
    }

    public void setRealName(String realName)
    {
        this.realName = realName;
    }

    public String getWxId()
    {
        return wxId;
    }

    public void setWxId(String wxId)
    {
        this.wxId = wxId;
    }

    public String getQrCode()
    {
        return qrCode;
    }

    public void setQrCode(String qrCode)
    {
        this.qrCode = qrCode;
    }

    public String getOpenId()
    {
        return openId;
    }

    public void setOpenId(String openId)
    {
        this.openId = openId;
    }

    public String getAutoOrder()
    {
        return autoOrder;
    }

    public void setAutoOrder(String autoOrder)
    {
        this.autoOrder = autoOrder;
    }

    public String getStatus()
    {
        return status;
    }

    public void setStatus(String status)
    {
        this.status = status;
    }

    public String getIsLike()
    {
        return isLike;
    }

    public void setIsLike(String isLike)
    {
        this.isLike = isLike;
    }

    public String getIsDynamicAudit()
    {
        return isDynamicAudit;
    }

    public void setIsDynamicAudit(String isDynamicAudit)
    {
        this.isDynamicAudit = isDynamicAudit;
    }

    public String getIsNewShow()
    {
        return isNewShow;
    }

    public void setIsNewShow(String isNewShow)
    {
        this.isNewShow = isNewShow;
    }

    public SysDept getDept()
    {
        return dept;
    }

    public void setDept(SysDept dept)
    {
        this.dept = dept;
    }

    public Long getUserLevel()
    {
        return userLevel;
    }

    public void setUserLevel(Long userLevel)
    {
        this.userLevel = userLevel;
    }

    public ConfigBase getShopInfo()
    {
        return shopInfo;
    }

    public void setShopInfo(ConfigBase shopInfo)
    {
        this.shopInfo = shopInfo;
    }

    public Level getLevelInfo()
    {
        return levelInfo;
    }

    public void setLevelInfo(Level levelInfo)
    {
        this.levelInfo = levelInfo;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("userId", getUserId())
            .append("deptId", getDeptId())
            .append("shopId", getShopId())
            .append("userName", getUserName())
            .append("nickName", getNickName())
            .append("email", getEmail())
            .append("phonenumber", getPhonenumber())
            .append("wxId", getWxId())
            .append("qrCode", getQrCode())
            .append("openId", getOpenId())
            .append("sex", getSex())
            .append("avatar", getAvatar())
            .append("password", getPassword())
            .append("status", getStatus())
            .append("isLike", getIsLike())
            .append("isDynamicAudit", getIsDynamicAudit())
            .append("isNewShow", getIsNewShow())
            .append("loginIp", getLoginIp())
            .append("loginDate", getLoginDate())
            .append("userLevel", getUserLevel())
            .append("serviceType", getServiceType())
            .append("active", getActive())
            .append("birthday", getBirthday())
            .append("constellation", getConstellation())
            .append("userSort", getUserSort())
            .append("tags", getTags())
            .append("userProfile", getUserProfile())
            .append("address", getAddress())
            .append("addressCode", getAddressCode())
            .append("coordinate", getCoordinate())
            .append("images", getImages())
            .append("speech", getSpeech())
            .append("score", getScore())
            .append("scoreTotal", getScoreTotal())
            .append("isRealName", getIsRealName())
            .append("realName", getRealName())
            .append("wxId", getWxId())
            .append("autoOrder", getAutoOrder())
            .append("dept", getDept())
            .append("shopInfo", getShopInfo())
            .append("levelInfo", getLevelInfo())
            .append("delFlag", getDelFlag())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .toString();
    }
}
